<template>
	<view>
		<view class="goodCard card" v-for="item in list" :key="item.id">
			<view class="goodCard-main">
				<image class="mainLeft" :src="item.goods_image" mode=""></image>
				<view class="mainRight">
					<view class="name u-line-2">
						{{item.goods_name}}
					</view>

					<view class="priceNum">
						<text>¥{{item.goods_price}}</text>
						<template v-if="typeState=='2'">
							<view class="fun" :class="item.server_type===2?'fun2':''">
								{{item.server_type===1? '上门服务': '到店到店服务'}}
							</view>
						</template>
						<template v-else>
							<view>
								<image style="display: inline-block; width: 20rpx; height: 20rpx;margin-right: 10rpx; "
									src="../../static/close.png" mode=""></image>
								<text style="color: rgba(0, 0, 0, 0.8);">{{item.pay_num}}</text>
							</view>
						</template>
					</view>
				</view>
			</view>
			<view class="goodCard-footer">
				<text style="color: rgba(0, 0, 0, 0.8);margin-right: 10rpx; ">共计{{item.pay_num}}件</text>
				<text style="color: rgba(0, 0, 0, 0.8);">实付款:</text>
				<text>￥{{item.pay_price}}</text>
			</view>
		</view>
	</view>

</template>

<script>
	export default {
		props: {
			// 商品信息
			list: {
				type: Array,
				require: true
			},
			// 一级分类
			typeState: {
				type: String,
				require: true
			}
		}
	}
</script>

<style lang="scss" scoped>
	.goodCard {

		&-main {
			display: flex;
			justify-content: space-between;
			box-sizing: border-box;
			padding-bottom: 30rpx;
			border-bottom: 1rpx solid rgba(171, 171, 171, 0.2);

			.mainLeft {
				width: 180rpx;
				height: 180rpx;
			}

			.mainRight {
				flex: 1;
				margin-left: 24rpx;
				font-weight: 500;
				text-align: left;
				line-height: 40rpx;

				.name {
					height: 88rpx;
					line-height: 44rpx;

					color: rgba(0, 0, 0, 0.8);
					font-size: 26rpx;
				}

				.fun {
					border-radius: 25rpx;
					box-sizing: border-box;
					padding: 5rpx 24rpx;
					background: rgba(236, 237, 254, 1);
					color: $boxBg;
					font-size: 20rpx;
					font-weight: 500;
				}

				.fun2 {
					background: #FFF3F6 !important;
					color: #FF718C !important;
				}

				.priceNum {
					color: $priceText;
					margin-top: 55rpx;
					display: flex;
					justify-content: space-between;
					align-items: center;
					font-size: 26rpx;
					font-weight: 400;
				}
			}
		}

		&-footer {
			margin-top: 18rpx;
			text-align: right;
			height: 40rpx;
			line-height: 40rpx;
			color: $priceText;
			font-size: 28rpx;
			font-weight: 400;
		}
	}
</style>
